<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    /* Object.prototype.toString.call(obj).slice(8, -1) */

    console.log({}.toString())  // [object Object]
    console.log([1, 2].toString()) // 调用数组的原型对象上的toString方法
    console.log(new Date().toString()) // 

    console.log(Object.prototype.toString.call([1, 3])) // [object Array]
    console.log(Object.prototype.toString.call(new Date())) // [object Date]

    console.log([])

    // 函数的call方法可以让一个函数成为任意对象的方法调用

    // const a = 2
    // a.toString() // new Number(a).toString()
    // 'abc'.length  // new String('abc').length
    
  </script>
</body>
</html>